<template>
  <a-card :bordered="false">
    <detail-list title="医生信息">
      <detail-list-item term="姓名">{{doctorInfo.name}}</detail-list-item>
      <detail-list-item term="手机号">{{doctorInfo.mobile}}</detail-list-item>
      <detail-list-item term="所属医院">{{doctorInfo.hospital}}</detail-list-item>
      <detail-list-item term="科室">{{doctorInfo.department}}</detail-list-item>
      <detail-list-item term="擅长">{{doctorInfo.department}}</detail-list-item>
    </detail-list>


    <div class="title">医生助理列表：</div>
    <a-table
      rowKey="id"
      :columns="columns"
      :dataSource="assistantInfo"
      class="j-table-force-nowrap">
    </a-table>
  </a-card>
</template>

<script>
import PageLayout from '@/components/page/PageLayout'
import DetailList from '@/components/tools/DetailList'
import ABadge from "ant-design-vue/es/badge/Badge"
import { getAction } from '@api/manage'
const DetailListItem = DetailList.Item

export default {
  components: {
    PageLayout,
    ABadge,
    DetailList,
    DetailListItem,
  },
  data () {
    return {
      columns: [
        {
          title:'助理id',
          align:"center",
          dataIndex: 'id'
        },
        {
          title:'姓名',
          align:"center",
          dataIndex: 'name'
        },
        {
          title:'手机号',
          align:"center",
          dataIndex: 'mobile'
        },
      ],
      url: {
        queryDS: "/doctor/doctor/queryAssistantInfo",
      },
      doctorInfo:{},    //医生数据
      assistantInfo:{}, //助理数据
    }
  },
  computed: {
    title () {
      return this.$route.meta.title
    }
  },
  created() {
    this.getInfo(this.$route.params.id);
  },
  methods:{
    //加载医生、助理信息
    getInfo(id){
      let param = {};
      param.id=id;
      getAction(this.url.queryDS,param).then(res=>{
        this.doctorInfo    = res.result[0];
        this.assistantInfo = res.result[1];
      })
    },
  }
}
</script>

<style lang="less" scoped>
.title {
  color: rgba(0,0,0,.85);
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 16px;
}
</style>